<?php
/**
 * - Configure the project
 */
// SQL encoding
define(SQL_ENCODING, "utf8");
// Document root, the folder store the project. Not following by /
define("DOCUMENT_ROOT", realpath(dirname(__FILE__) . '/..'));
// Root related to admin system
define("ADMIN_MODULE_DIR", DOCUMENT_ROOT . "/moduleAdmin");
define("ADMIN_MODULE_ACTION_DIR", ADMIN_MODULE_DIR . "/actions");
define("ADMIN_MODULE_TEMPLATES_DIR", ADMIN_MODULE_DIR . "/templates");

//root home system
define("HOME_MODULE_DIR", DOCUMENT_ROOT . "/moduleHome");
define("HOME_MODULE_ACTION_DIR", HOME_MODULE_DIR . "/actions");
define("HOME_MODULE_TEMPLATES_DIR", HOME_MODULE_DIR . "/templates");

//test home system
define("TEST_MODULE_DIR", DOCUMENT_ROOT . "/moduleTest");
define("TEST_MODULE_ACTION_DIR", TEST_MODULE_DIR . "/actions");
define("TEST_MODULE_TEMPLATES_DIR", TEST_MODULE_DIR . "/templates");

//
define("BUKKEN_MODULE_DIR", DOCUMENT_ROOT . "/moduleBukken");
define("BUKKEN_MODULE_ACTION_DIR", BUKKEN_MODULE_DIR . "/actions");
define("BUKKEN_MODULE_TEMPLATES_DIR", BUKKEN_MODULE_DIR . "/templates");

include_once(DOCUMENT_ROOT . "/lib/core/BasePDO.class.php");
// Configure the DB
$dbInfo = array(dbtype => 'mysql',
				driver => '{MySQL ODBC 5.1 Driver}',
				host => 'localhost',
				username => 'root',
				password => 'root',
				database => 'runsys',
				persist => true
			);
if (!$dbInfo['persist']) {
	$dsn = 	"odbc:DRIVER=" . $dbInfo['driver'] .
			";SERVER=" . $dbInfo['host'] .
			";Database=" . $dbInfo['database'] .
			";uid=" . $dbInfo['username'] .
			";password=" . $dbInfo['password'] .
			";option=3;";
	$dbcon = new BasePDO($dsn);
}
else {
	$dsn = 	$dbInfo['dbtype'] . 
			":dbname=" . $dbInfo['database'] . 
			";host=" . $dbInfo['host'];
	$dbcon = new BasePDO($dsn, $dbInfo['username'], $dbInfo['password']);		
}
?>